"use strict";
const app = new (require('koa'))();
const Router = require('koa-router');
const bodyParser = require('koa-bodyparser');
const selfLog = new (require('self-log'))('webhooks');

app.use(selfLog.requestLogger());
app.use(bodyParser()); // post 请求参数

// 路由
const appRouter = new Router({ prefix: '/web_hooks' });
appRouter.use(require('./routes/index').routes());
app.use(appRouter.routes()).use(appRouter.allowedMethods());

module.exports = app;
